from sqlalchemy import Column, BigInteger,Integer, String, Text,UniqueConstraint
from sqlalchemy.orm import Mapped, mapped_column
from model.base_model import BaseModel
from model.mixin_timestamp import TimestampMixin
from sqlalchemy.dialects.mysql import insert

class Quote(BaseModel,TimestampMixin):
    __tablename__ = 'users_famous_quotes'
    __table_args__ = (
        UniqueConstraint("text", name="uniq_text"),
    )
    id = Column(BigInteger, primary_key=True, autoincrement=True, comment="ID")
    created_at = Column(BigInteger, nullable=False, default=0, comment="创建时间")
    created_by = Column(BigInteger, nullable=False, default=0, comment="创建人")
    updated_at = Column(BigInteger, nullable=False, default=0, comment="更新时间")
    updated_by = Column(BigInteger, nullable=False, default=0, comment="更新人")
    deleted_at = Column(BigInteger, nullable=False, default=0, comment="软删除时间")
    deleted_by = Column(BigInteger, nullable=False, default=0, comment="删除人")
    # text = Column(Text(collation="utf8mb4_bin"), nullable=False, comment="名言警句")
    text = Column(String(255, collation="utf8mb4_bin"), nullable=False, comment="名言警句")
